#lang racket

(define (sqrn a n)
  (cond
    [(= n 0) 1]
    [(= n 1) a]
    [else (* a (sqrn a (- n 1)))])
  )

(define BASE 1)

(define (less-number base n)
  (cond
    [(> (sqrn 2 base) n) (- base 1)]
    [else (less-number (+ base 1) n)])
  )

(define (find-number n)
  (cond
    [(< n 1) (error 'find-number "find-number invalid parameter!")]
    [else (sqrn 2 (less-number BASE n))]
    )
  )

; Test
(sqrn 2 3)
(find-number 50)